package com.easylinkin.linkappapi.common.config;

import com.aliyun.oss.OSSClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description 阿里OSS三方组件管理
 * @ClassName MessageConfig
 * @Author 徐国庆
 * @date 2020.05.15 13:57
 */
@Configuration
public class OssConfig {

    private static final Logger LOGGER = LoggerFactory.getLogger(OssConfig.class);

    /**
     * 阿里OSS 参数
     */
    @Value("${oss.accessKeyId}")
    private String accessId;
    @Value("${oss.accessKeySecret}")
    private String accessKey;
    @Value("${oss.endPoint}")
    private String endpoint;
    /**
     * OSSClient 的实例管理
     */
    @Bean
    public OSSClient ossClient() {
        OSSClient client = new OSSClient(endpoint, accessId, accessKey);
        return client;
    }

}

